package com.tn.user.controller;

import com.databstech.apis.result.response.ResultVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author tn
 * @version 1
 * @ClassName GatewayAuthTestController
 * @description gateway 鉴权测试
 * @date 2020/8/11 12:58
 */
@Api(tags = "gateway鉴权测试")
@RestController
@RequestMapping("gateway/auth")
public class GatewayAuthTestController {


    @ApiOperation(value = "测试gateway是否把 name 注入到了请求头")
    @GetMapping(value = "test01")
    public ResultVO test01(@ApiParam(hidden = true) @RequestHeader(name = "loginName") String loginName) {
        return ResultVO.success("传入的token用户name为:"+loginName);
    }
}
